/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package biofilter.sources;

import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import biofilter.exceptions.InvalidRecordException;
import static org.junit.Assert.*;
import biofilter.records.Record;
import biofilter.records.MyStubRecord;

/**
 *
 * @author t9i
 */
public class RecordsFileTest {

    public RecordsFileTest() {
    }

    @BeforeClass
    public static void setUpClass() throws Exception {
    }

    @AfterClass
    public static void tearDownClass() throws Exception {
    }

    @Before
    public void setUp() {
    }

    @After
    public void tearDown() {
    }

    /**
     * Test of createRecordClass method, of class RecordsFile.
     */
    @Test
    public void testCreateRecordClass() throws Exception {
        System.out.println("createRecordClass");
        System.out.println("running in " + System.getProperty("user.dir"));
        String recordClassName = "biofilter.records.MyStubRecord";
        RecordsFile instance = new RecordsFile("test/testdata/emptyfile", recordClassName);
        instance.createRecordClass(recordClassName);
        // TODO review the generated test code and remove the default call to fail.
        //fail("The test case is a prototype.");
    }

    /**
     * Test of getRecordClassName method, of class RecordsFile.
     */
    @Test
    public void testGetRecordClassName() {
        System.out.println("getRecordClassName");
        RecordsFile instance = null;
        String expResult = "";
        String result = instance.getRecordClassName();
        assertEquals(expResult, result);
        // TODO review the generated test code and remove the default call to fail.
        fail("The test case is a prototype.");
    }

    /**
     * Test of getRecord method, of class RecordsFile.
     */
    @Test
    public void testGetRecord() throws Exception {
        System.out.println("getRecord");
        RecordsFile instance = null;
        Record expResult = null;
        Record result = instance.getRecord();
        assertEquals(expResult, result);
        // TODO review the generated test code and remove the default call to fail.
        fail("The test case is a prototype.");
    }

    /**
     * Test of setSource method, of class RecordsFile.
     */
    @Test
    public void testSetSource() throws Exception {
        System.out.println("setSource");
        Object source = null;
        RecordsFile instance = null;
        instance.setSource(source);
        // TODO review the generated test code and remove the default call to fail.
        fail("The test case is a prototype.");
    }

    /**
     * Test of clearRecords method, of class RecordsFile.
     */
    @Test
    public void testClearRecords() {
        System.out.println("clearRecords");
        RecordsFile instance = null;
        instance.clearRecords();
        // TODO review the generated test code and remove the default call to fail.
        fail("The test case is a prototype.");
    }

    /**
     * Test of resetSource method, of class RecordsFile.
     */
    @Test
    public void testResetSource() throws Exception {
        System.out.println("resetSource");
        RecordsFile instance = null;
        instance.resetSource();
        // TODO review the generated test code and remove the default call to fail.
        fail("The test case is a prototype.");
    }

    /**
     * Test of isFileBased method, of class RecordsFile.
     */
    @Test
    public void testIsFileBased() {
        System.out.println("isFileBased");
        RecordsFile instance = null;
        boolean expResult = false;
        boolean result = instance.isFileBased();
        assertEquals(expResult, result);
        // TODO review the generated test code and remove the default call to fail.
        fail("The test case is a prototype.");
    }

    /**
     * Test of readRecordString method, of class RecordsFile.
     */
    @Test
    public void testReadRecordString() throws Exception {
        System.out.println("readRecordString");
        RecordsFile instance = null;
        String expResult = "";
        String result = instance.readRecordString();
        assertEquals(expResult, result);
        // TODO review the generated test code and remove the default call to fail.
        fail("The test case is a prototype.");
    }

    /**
     * Test of eof method, of class RecordsFile.
     */
    @Test
    public void testEof() {
        System.out.println("eof");
        RecordsFile instance = null;
        boolean expResult = false;
        boolean result = instance.eof();
        assertEquals(expResult, result);
        // TODO review the generated test code and remove the default call to fail.
        fail("The test case is a prototype.");
    }

    /**
     * Test of peek method, of class RecordsFile.
     */
    @Test
    public void testPeek() throws Exception {
        System.out.println("peek");
        RecordsFile instance = null;
        Record expResult = null;
        Record result = instance.peek();
        assertEquals(expResult, result);
        // TODO review the generated test code and remove the default call to fail.
        fail("The test case is a prototype.");
    }

    /**
     * Test of skip method, of class RecordsFile.
     */
    @Test
    public void testSkip() {
        System.out.println("skip");
        String currentRecordString = "";
        RecordsFile instance = null;
        boolean expResult = false;
        boolean result = instance.skip(currentRecordString);
        assertEquals(expResult, result);
        // TODO review the generated test code and remove the default call to fail.
        fail("The test case is a prototype.");
    }

    /**
     * Test of setHeaderKeyword method, of class RecordsFile.
     */
    @Test
    public void testSetHeaderKeyword() {
        System.out.println("setHeaderKeyword");
        String headerKeyword = "";
        RecordsFile instance = null;
        instance.setHeaderKeyword(headerKeyword);
        // TODO review the generated test code and remove the default call to fail.
        fail("The test case is a prototype.");
    }

    /**
     * Test of getHeaderKeyword method, of class RecordsFile.
     */
    @Test
    public void testGetHeaderKeyword() {
        System.out.println("getHeaderKeyword");
        RecordsFile instance = null;
        String expResult = "";
        String result = instance.getHeaderKeyword();
        assertEquals(expResult, result);
        // TODO review the generated test code and remove the default call to fail.
        fail("The test case is a prototype.");
    }



    public class MyStubRecord implements Record {

        private String s = null;

        @Override
        public String get() {
            return this.s;
        }

        @Override
        public void set(String r) throws IllegalArgumentException {
            this.s = r;
        }
    }
}
